Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
directory-exists
Advanced tools
Check if a directory exists - synchronously or asynchronously
$ npm install --save directory-exists
directory
should be a string of a relative or absolute path.
const directoryExists = require('directory-exists');
directoryExists(directory, (error, result) => {
console.log(result); // result is a boolean
});
If no callback function is supplied, directoryExists returns a promise.
const directoryExists = require('directory-exists');
directoryExists(directory).then(result => {
console.log(result); // result is a boolean
});
const directoryExists = require('directory-exists');
(async function() {
const result = await directoryExists(directory);
console.log(result); // result is a boolean
})();
const directoryExists = require('directory-exists');
directoryExists.sync(directory); // retuns a boolean
fs.exists
?Because asynchronous fs.exists
is deprecated. Synchronous fs.existsSync
is still fine to use, but this library does both sync and async.
MIT © timmydoza
FAQs
Check to see if a directory exists
The npm package directory-exists receives a total of 1,258 weekly downloads. As such, directory-exists popularity was classified as popular.
We found that directory-exists demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.